/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.bootstrap.jsf.bootstrap.component.util;

import java.util.Arrays;
import java.util.List;

/**
 *
 * @author alex
 */
public class Utilities {
    public static String markerWords (String value , String tokens , String color) {
        List<String> tokenList = Arrays.asList(tokens.trim().split(","));
        
        String resultSet = value;
        
        for (String token : tokenList) {
            resultSet = resultSet.replace( " " + token.trim() + " ", "&nbsp;&nbsp;<span class=\"label label-info \" style=\"background-color :" +color+ "\">"+token+"</span>&nbsp;&nbsp;");
        }
        
        return resultSet;
    }
}
